﻿using DiaoPaiDaYin;
using DXApplicationTangche.DTO.任务DTO;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DXApplicationTangche.service
{
    public class ProcessService
    {
        /// <summary>
        /// 根据流程ID取流程
        /// </summary>
        /// <param name="processId"></param>
        /// <returns></returns>
        public static List<ProcessDto> getProcessById(String processId) {
            String sql = "SELECT\n" +
                "	ID,\n" +
                "	PROCESS_ID,\n" +
                "	USER_TASK,\n" +
                "	PROCESS_INDEX \n" +
                "FROM\n" +
                "	t_process_define \n" +
                "WHERE\n" +
                "	PROCESS_ID = '"+ processId + "' \n" +
                "ORDER BY\n" +
                "	PROCESS_INDEX;";
            DataTable dt = SQLmtm.GetDataTable(sql);

            List<ProcessDto> processDtos = new List<ProcessDto>();
            foreach (DataRow dataRow in dt.Rows) {
                processDtos.Add(new ProcessDto(dataRow));
            }
            return processDtos;
        }
    }
}
